# !/usr/bin/env python
# -*- coding: utf-8 -*-
"""
@Time        : 2021/10/12 10:44
@Author      : Albert Darren
@Contact     : 2563491540@qq.com
@File        : enhance.py
@Version     : Version 1.0.0
@Description : TODO
@Created By  : PyCharm
"""
from PIL import ImageEnhance, Image
from DIP_experiment_4.util import contrast_show

img_path = "../experiment_fig/beans.png"
my_font = "C:/Windows/Fonts/simsun.ttc"
origin_im = Image.open(img_path)  # RGBA
r, g, b, a = origin_im.split()
contrast_im1 = ImageEnhance.Contrast(r).enhance(5)
contrast_im2 = ImageEnhance.Contrast(r).enhance(10)
im_dict = {"原始图像r通道": r, "factor=5的图像r通道": contrast_im1,
           "factor=10的图像r通道": contrast_im2}
contrast_show(im_dict, (1, 3), wspace=0.4, font=my_font)
